import Vue from "vue";
import VueRouter from "vue-router";

import Detail from "@/views/detail";
import Layout from "@/views/layout";
import Login from "@/views/login";
import Register from "@/views/register";
import skiPcity from '@/views/skiPcity.vue'

import Article from "@/views/article";
import Collect from "@/views/collect";
import Like from "@/views/like";
import User from "@/views/user";

Vue.use(VueRouter);

const routes = [
  {
    path: "/login",
    component: Login,
  },
  {
    path: "/register",
    component: Register,
  },
  {
    path: "/article/:id",
    component: Detail,
  },
  {
    path: "/skiPcity",
    component:skiPcity
  },
  {
    path: "/",
    component: Layout,
    redirect: "/article",
    children: [
      {
        path: "/article",
        component: Article,
      },
      {
        path: "/collect",
        component: Collect,
      },
      {
        path: "/like",
        component: Like,
      },
      {
        path: "/user",
        component: User,
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
